﻿using BCEntity.TMS.Packing.PackingConfig;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.Packing.PackingConfig
{
    public interface IPackingConfigData
    {
        /// <summary>
        /// 添加包装材料配置
        /// </summary>
        /// <param name="entity">包装材料配置信息</param>
        /// <returns></returns>
        Task<PackingConfigEntity> InsertAsync(PackingConfigEntity entity);

        /// <summary>
        /// 获取包装材料配置记录
        /// </summary>
        /// <param name="packingCategoryConfigId">包装材料分类配置Id</param>
        /// <param name="packingTitle">包装材料标题</param>
        /// <param name="enabled">是否启用</param>
        /// <param name="createStartDate">创建开始日期</param>
        /// <param name="createEndDate">创建结束日期</param>
        /// <param name="pageIndex">页号</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        Task<(IEnumerable<PackingConfigViewEntity>, int)> Query(int? packingCategoryConfigId, string packingTitle, bool? enabled, DateTime? createStartDate, DateTime? createEndDate, int pageIndex, int pageSize);

        /// <summary>
        /// 根据包装材料分类配置Id 获取包装材料配置记录
        /// </summary>
        /// <param name="packingCategoryConfigId">包装材料分类配置Id</param>
        /// <returns></returns>
        Task<PackingConfigEntity> GetEntityByCategoryConfigId(int packingCategoryConfigId);

        /// <summary>
        /// 获取包装材料配置
        /// </summary>
        /// <param name="packingConfigId">包装材料配置Id</param>
        /// <returns></returns>
        Task<PackingConfigEntity> GetEntity(long packingConfigId);

        /// <summary>
        /// 删除包装材料配置
        /// </summary>
        /// <param name="packingConfigId">包装材料配置Id</param>
        /// <returns></returns>
        Task<int> Delete(int packingConfigId);

        /// <summary>
        /// 获取包装材料配置列表
        /// </summary>
        /// <param name="packingCategoryConfigId">包装材料分类配置Id</param>
        /// <param name="packingTitle">包装材料标题</param>
        /// <param name="enabled">是否启用</param>
        /// <returns></returns>
        Task<IEnumerable<PackingConfigViewEntity>> GetList(int? packingCategoryConfigId, string packingTitle, bool? enabled);

        /// <summary>
        /// 更新包装材料配置
        /// </summary>
        /// <param name="entity">包装材料配置</param>
        /// <returns></returns>
        Task<PackingConfigEntity> Update(PackingConfigEntity entity);
    }
}